package com.zjxh.zjxh.common.exception;

import com.zjxh.zjxh.common.constant.CMEnum;
import lombok.Getter;
import lombok.Setter;

/**
 * @description: ㅤ公共异常
 * @author: oyp @Date: 2020/4/20 on 2:03 下午
 */
@Getter
@Setter
public class CommonException extends RuntimeException {

  private static final long serialVersionUID = -8837777959857440243L;
  private String code;
  private String msg;

  public CommonException(String msg) {
    this.code = CMEnum.ERROR.getCode();
    this.msg = msg;
  }

  public CommonException(CMEnum cmEnum, String msg) {
    this.code = cmEnum.getCode();
    this.msg = msg;
  }

  public CommonException(CMEnum cmEnum) {
    this.code = cmEnum.getCode();
    this.msg = cmEnum.getMsg();
  }
}
